<?
ob_start();
session_start();
// list of header
// header untuk judul employee/karyawan
function TitleKaryawan(){
	echo"
	<table width=93% class='table_indent2'>
	 <tr>
	  <td align=left class=line_bottom>&nbsp;&nbsp;<b>MASTER KARYAWAN</b></td>
	 </tr>
	</table>
	";
}
function TitleKaryawanSearch(){
	echo"
	<table width=93% class='table_indent2'>
	 <tr>
	  <td align=left class=line_bottom>&nbsp;&nbsp;<b>HASIL PENCARIAN MASTER KARYAWAN</b></td>
	 </tr>
	</table>
	";
}
// header untuk table employee
function HeadKaryawanFront(){
	echo"
	 <tr class=headlist>
	  <td width=1%>&nbsp;</td>
	  <td width=2%>NIK</td>
	  <td width=15%>Nama Lengkap</td>
	  <td width=20%>Alamat</td>
	  <td width=15%>Biro/Divisi/Unit Kerja/Cabang</td>
	  <td width=10%>Lokasi/Tempat</td>
	  <td width=13%>Status</td>
	  <td width=20>&nbsp</td>
	 </tr>
	";
}

// header untuk search medical
function SearchMedical($conn,$bulan1,$bulan2,$tahun1,$tahun2,$divisi,$jenis){
		echo"
		  <form method='get' action=search.php>
		   <table border=0 width=100%>
		    <tr>
			 <td align=right>&nbsp;&nbsp;NIK/Nama:</td>
			 <td>
			 <input type='hidden' name='show' value='medical'>
			 <input type='text' name='keyword'></td>
			 <td>&nbsp;&nbsp;Periode: <!-- 
			 <select name='bulan1'>
			  <option value='' -->";
			  echo"
			 <!--</select>-->
<input type=\"text\" maxlength=\"10\" size=\"11\" name=\"awal\" /> <a href=\"javascript:calA.popup();\"><img src=\"../../images/cal.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Kalendar\" title=\"Kalendar\"></a>&nbsp;s/d&nbsp;<input type=\"text\" maxlength=\"10\" size=\"11\" name=\"akhir\" /> <a href=\"javascript:calB.popup();\"><img src=\"../../images/cal.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Kalendar\" title=\"Kalendar\"></a>			 
			 </td>
			</tr>
			<tr>
			 <td colspan=1>&nbsp;</td>
			 <td>&nbsp;</td>
			 <td>&nbsp;&nbsp;Divisi:&nbsp;&nbsp;&nbsp;
			   <select name='divisi'>
				<option value=''>--semua--</option>";
				$sq2 = mssql_query("SELECT * FROM VLevelCabang WHERE status='1' ORDER BY uraian ASC",$conn);
				while($rq2 = mssql_fetch_array($sq2)){
					echo"<option value='".$rq2[kode_so]."'";
					if($divisi == $rq2[kode_so]){
						echo" selected";
					}
					echo">$rq2[uraian]</option>";
				}
			   echo"</select>
			 </td>
			</tr>
			<tr>
			 <td>&nbsp;</td>
			 <td>&nbsp;</td>
			 <td>&nbsp;&nbsp;Status:&nbsp;&nbsp;&nbsp;<select name=status>
			  <option value=''>--semua--</option>
			  <option value='A'>Disetujui</option>
			  <option value='P'>Pengajuan</option>
			 </select>
			 Jenis: <select name='jenis'>
			  <option value='RJ'";
			  if($jenis == "RJ"){
			  	echo" selected";
			  }
			  echo">Rawat Jalan</option>
			  <option value='RI'";
			  if($jenis == "RI"){
			  	echo" selected";
			  }
			  echo">Rawat Inap</option>
			  <option value='KC'";
			  if($jenis == "KC"){
			  	echo" selected";
			  }
			  echo">Kacamata</option>
			  <option value='PR'";
			  if($jenis == "PR"){
			  	echo" selected";
			  }
			  echo">Persalinan</option>
			 </select><br><br>
			 <input type='submit' value='Cari' class='button'>
			   <input type='button' value='Tambah' class='button' onclick='Javascript:location.href=\"../form/frm_emp_medical.php?pengajuan=yes\"'>
			 </td>
			</tr>
		   </table>
		   </form>
		   <script language=\"javascript\">
	var calA = new calendar1(document.forms[0].elements['awal']);
	calA.year_scroll = true;
	calA.time_comp = false;

	var calB = new calendar1(document.forms[0].elements['akhir']);
	calB.year_scroll = true;
	calB.time_comp = false;
</script>

		   ";
}

// header untuk search CUti
function SearchCuti($conn,$bulan1,$bulan2,$tahun1,$tahun2,$divisi){
		echo"
		  <form method='get' action=search.php>
		   <table border=0 align=right width=100%>
		    <tr>
			 <td align=right>&nbsp;&nbsp;NIK/Nama:</td>
			 <td>
			 <input type='hidden' name='show' value='cuti'>
			 <input type='text' name='keyword'></td>
			 <td>Periode:</td>
			 <td><select name='bulan1'>
			  <option value=''";
			  if(empty($bulan1)){ echo" selected"; }
			  echo">--Bulan--</option>";
			  echo"
			   <option value='01'"; if($bulan1 == "01"){ echo" selected"; } else {} echo">Januari</option>
			   <option value='02'"; if($bulan1 == "02"){ echo" selected"; } else {} echo">Februari</option>
			   <option value='03'"; if($bulan1 == "03"){ echo" selected"; } else {} echo">Maret</option>
			   <option value='04'"; if($bulan1 == "04"){ echo" selected"; } else {} echo">April</option>
			   <option value='05'"; if($bulan1 == "05"){ echo" selected"; } else {} echo">Mei</option>
			   <option value='06'"; if($bulan1 == "06"){ echo" selected"; } else {} echo">Juni</option>
			   <option value='07'"; if($bulan1 == "07"){ echo" selected"; } else {} echo">Juli</option>
			   <option value='08'"; if($bulan1 == "08"){ echo" selected"; } else {} echo">Agustus</option>
			   <option value='09'"; if($bulan1 == "09"){ echo" selected"; } else {} echo">September</option>
			   <option value='10'"; if($bulan1 == "10"){ echo" selected"; } else {} echo">Oktober</option>
			   <option value='11'"; if($bulan1 == "11"){ echo" selected"; } else {} echo">November</option>
			   <option value='12'"; if($bulan1 == "12"){ echo" selected"; } else {} echo">Desember</option>
			 </select>
			 <select name='tahun1'>
			  <option value=''>--Tahun--</option>";
			  // get tahun restitusi
			  $sres = mssql_query("SELECT Periode FROM MedicalRestitusiDetail GROUP BY Periode ORDER BY Periode ASC",$conn);
			  while($rres = mssql_fetch_array($sres)){
			  	echo"<option value='$rres[Periode]'";
				if($rres[Periode] == $tahun1){
				 echo" selected";
				}
				echo">$rres[Periode]</a>";
			  }			  
			  echo"
			 </select>
			 -
			 <select name='bulan2'>
			  <option value=''";
			  if(empty($bulan2)){ echo"selected"; }			  
			  echo">--Bulan--</option>
			   <option value='01'"; if($bulan2 == "01"){ echo" selected"; } else {} echo">Januari</option>
			   <option value='02'"; if($bulan2 == "02"){ echo" selected"; } else {} echo">Februari</option>
			   <option value='03'"; if($bulan2 == "03"){ echo" selected"; } else {} echo">Maret</option>
			   <option value='04'"; if($bulan2 == "04"){ echo" selected"; } else {} echo">April</option>
			   <option value='05'"; if($bulan2 == "05"){ echo" selected"; } else {} echo">Mei</option>
			   <option value='06'"; if($bulan2 == "06"){ echo" selected"; } else {} echo">Juni</option>
			   <option value='07'"; if($bulan2 == "07"){ echo" selected"; } else {} echo">Juli</option>
			   <option value='08'"; if($bulan2 == "08"){ echo" selected"; } else {} echo">Agustus</option>
			   <option value='09'"; if($bulan2 == "09"){ echo" selected"; } else {} echo">September</option>
			   <option value='10'"; if($bulan2 == "10"){ echo" selected"; } else {} echo">Oktober</option>
			   <option value='11'"; if($bulan2 == "11"){ echo" selected"; } else {} echo">November</option>
			   <option value='12'"; if($bulan2 == "12"){ echo" selected"; } else {} echo">Desember</option>
			 </select>
			 <select name='tahun2'>
			  <option value=''>--Tahun--</option>";
			  $sres2 = mssql_query("SELECT Periode FROM MedicalRestitusiDetail GROUP BY Periode ORDER BY Periode DESC",$conn);
			  while($rresw = mssql_fetch_array($sres2)){
			  	echo"<option value='$rresw[Periode]'";
					if($rresw[Periode] == $tahun2){
					 echo" selected";
					}				
				echo">$rresw[Periode]</a>";
			  }			  
			  echo"
			 </select>
			 </td>
			</tr>
			<tr>
			 <td colspan=1>&nbsp;</td>
			 <td>&nbsp;</td>
			 <td>Divisi:</td>
			 <td><select name='divisi'>
				<option value=''>--semua--</option>";
				$sq2 = mssql_query("SELECT * FROM VLevelCabang WHERE status='1' ORDER BY uraian ASC",$conn);
				while($rq2 = mssql_fetch_array($sq2)){
					echo"<option value='".$rq2[kode_so]."'";
					if($divisi == $rq2[kode_so]){
						echo" selected";
					}
					echo">$rq2[uraian]</option>";
				}
			   echo"</select>
			 </td>
			</tr>
			<tr>
			 <td>&nbsp;</td>
			 <td>&nbsp;</td>
			 <td>Status:</td>
			 <td><select name=status>
			  <option value='A'>Disetujui</option>
			  <option value='P'>Pengajuan</option>
			 </select> &nbsp;&nbsp;Jenis Cuti:&nbsp;&nbsp;<select name=jenis_cuti>
			  <option value='CT'>Cuti Tahunan</option>
			  <option value='CB'>Cuti Besar</option>
			  <option value='CK'>Cuti Khusus</option>
			 </select>
			 </td>
			</tr>
			<tr>
			 <td>&nbsp;</td>
			 <td>&nbsp;</td>
			 <td>&nbsp;</td>
			 <td><input type='submit' value='Cari' class='button'></td>
			</tr>
		   </table>
		   </form>";
}

function SearchPlafonMedical($conn,$bulan1,$bulan2,$tahun1,$tahun2,$divisi){
		echo"
		  <form method='get' action=search.php>
		  <fieldset><legend>Pencarian Plafon Pengobatan</legend>
		   <table border=0 width=100%>
		    <tr>
			 <td align=right>&nbsp;&nbsp;NIK/Nama:</td>
			 <td>
			 <input type='hidden' name='show' value='setup_medical'>
			 <input type='text' name='keyword'></td>
			 <td>&nbsp;&nbsp;Periode: 
			 <select name='tahun1'>
			  <option value=''>--Tahun--</option>";
			  // get tahun restitusi
			  $sres = mssql_query("SELECT Periode FROM MedicalSetupAwal GROUP BY Periode ORDER BY Periode ASC",$conn);
			  while($rres = mssql_fetch_array($sres)){
			  	echo"<option value='$rres[Periode]'";
				if($rres[Periode] == $tahun1){
				 echo" selected";
				}
				echo">$rres[Periode]</a>";
			  }			  
			  echo"
			 </select>
			 </td>
			</tr>
			<tr>
			 <td colspan=1>&nbsp;</td>
			 <td>&nbsp;</td>
			 <td>&nbsp;&nbsp;Divisi:&nbsp;&nbsp;&nbsp;
			   <select name='divisi'>
				<option value=''>--semua--</option>";
				$sq2 = mssql_query("SELECT * FROM VLevelCabang WHERE status='1' ORDER BY uraian ASC",$conn);
				while($rq2 = mssql_fetch_array($sq2)){
					echo"<option value='".$rq2[kode_so]."'";
					if($divisi == $rq2[kode_so]){
						echo" selected";
					}
					echo">$rq2[uraian]</option>";
				}
			   echo"</select>
			 </td>
			</tr>
			<tr>
			 <td colspan=2>&nbsp;</td>
			 <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='submit' value='Cari' class='button'></td>
			</tr>
		   </table>
		   </form>";
}

// header untuk table employee
function HeadKaryawan(){
	echo"
	 <tr class=headlist>
	  <td>&nbsp;</td>
	  <td>NIK</td>
	  <td>Nama Lengkap</td>
	  <td>Tempat Lahir</td>
	  <td>Tanggal Lahir</td>
	  <td>Alamat</td>
	  <td>Telepon</td>
	  <td>Unit Kerja</td>
	 </tr>
	";
}

// header untuk table employee cv OL
function HeadKaryawan2(){
	echo"
	 <tr class=headlist>
	  <td>&nbsp;</td>
	  <td>NIK</td>
	  <td>Nama Lengkap</td>
	  <td>Divisi/Cabang/Biro/Unit Kerja</td>
	  <td></td>
	  <td>Pendidikan</td>
	  <td>Fungsional</td>
	  <td>Status</td>
	  <td></td>
	 </tr>
	";
}

// footer untuk pencarian
function Search($cat){
	echo"
	<table cellpadding=0 cellspacing=0 border=0 valign=middle align=center>
	 <tr>
	  <form action='search.php' method='get'>
	   <td valign=middle>&nbsp;Masukkan NIK / Nama: 
	    <input type='hidden' name='show' value='$cat'> 
	    <input type='text' name='keyword'>
	    <input type='submit' value='Search' class='button'>
	   </td>	
	  </form>
	 </tr>
	</table>
	";
}

// footer untuk pencarian
function SearchMK($cat,$conn,$st,$divisi,$sb){
	echo"
	<fieldset style=width:100%><legend>Pencarian</legend>
	<table cellpadding=0 cellspacing=0 border=0 valign=middle align=center width=97%>
   <form action='search.php' method='get'>
	 <tr>
	   <td>&nbsp; NIK / Nama: </td>
	   <td>&nbsp;<input type='hidden' name='show' value='$cat'><input type='text' name='keyword'></td>
	   <td width='100'>&nbsp;</td>
	   <td>Status Karyawan: &nbsp;</td>
	   <td><select name='st' style='width:350px;'>
	    <option value='all'>--semua--</option>";
	$sq = mssql_query("SELECT * FROM VStatusKaryawan",$conn);
	while($rq = mssql_fetch_array($sq)){
		echo"<option value='".$rq[kode]."'";
		if($st == $rq[kode]){
			echo" selected";
		}
		echo">$rq[Nama]</option>";
	}
		echo "<option value='Pelamar'";
		if($st == 'Pelamar'){
			echo" selected";
		}
		echo">Pelamar</option>
		</select>&nbsp;&nbsp;
		</td>
	 </tr>
	 <tr>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td>Divisi/Biro/Unit Kerja:</td>
	  <td>
	   <select style='width:350px;' name='divisi'>
	    <option value='all'>--semua--</option>";
		$sq2 = mssql_query("SELECT * FROM VLevelCabang WHERE status='1' ORDER BY uraian ASC",$conn);
		while($rq2 = mssql_fetch_array($sq2)){
			echo"<option value='".$rq2[kode_so]."'";
			if($divisi == $rq2[kode_so]){
				echo" selected";
			}
			echo">$rq2[uraian]</option>";
		}
		
	   echo" </select>
	  </td>
	 </tr> 
	 <tr>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td>Status Bekerja:</td>
	  <td>
	   <select style='width:350px;' name='sb'>
	    <option value='all'>--semua--</option>";
		
		echo"
		<option value='Berhenti'";
		if($sb == 'Berhenti'){
			echo" selected";
		}
		echo">Berhenti</option>
		
		<option value='Bekerja'";
		if($sb == 'Bekerja'){
			echo" selected";
		}
		
		echo">Bekerja</option>
	   </select>
	  </td>
	 </tr> 
	 <tr>
	  <td colspan='4' align=left>
	  <input type='submit' value='Cari' class='button'>
	  <input type=button value='Tambah Data' class=button Onclick='Javascript:location.href=\"../form/frm_emp.php\"'>
	  <input type=button value='Kirim ke Excel' class=button Onclick='Javascript:window.open(\"exp_excel.php?st=$st&amp;divisi=$divisi&amp;keyword=$keyword\");'>
	  </td>
	  <td align='left'><b>&raquo; <a href='#' onclick='Javascript:pop_pel();' style='text-decoration: underline;'>Pencarian Detil Pelamar</a> | <a href='#' onclick='Javascript:pop_rek();' style='text-decoration: underline;'>Rekruitment Pegawai</a> </b></td>
	 </tr>
	 <tr>
	  <td colspan='5'>&nbsp;</td>
	 </tr>
   </form>
	</table>
	</fieldset>
	";
}

// footer navigation (paging)
function Paging($pager,$page,$next,$limit,$keyword,$show,$conn,$st,$divisi,$sb){
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=100%><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?sb=$sb&show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?sb=$sb&show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?sb=$sb&show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?sb=$sb&show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?sb=$sb&show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	<td align=right valign=middle>";
	echo"</td>
	</tr></table><br>";
}

function PagingLap($pager,$page,$next,$limit,$keyword,$show,$conn,$st,$divisi,$stat_kar,$agama,$gender,$marital){
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=100%><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?agama=$agama&amp;marital=$marital&amp;gender=$gender&amp;stat_kar=$stat_kar&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?agama=$agama&amp;marital=$marital&amp;gender=$gender&amp;stat_kar=$stat_kar&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?agama=$agama&amp;marital=$marital&amp;gender=$gender&amp;stat_kar=$stat_kar&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?agama=$agama&amp;marital=$marital&amp;gender=$gender&amp;stat_kar=$stat_kar&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?agama=$agama&amp;marital=$marital&amp;gender=$gender&amp;stat_kar=$stat_kar&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	<td align=right valign=middle>";
	echo"</td><td align=right>&nbsp;</td>
	</tr></table><br>";
}

function PagingLapTr($pager,$page,$next,$limit,$keyword,$show,$conn,$st,$divisi,$stat_kar,$pendidikan,$jabatan,$golongan,$bulan1,$bulan2,$tahun2,$tahun1,$jns_kursus){
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=100%><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?pendidikan=$pendidikan&amp;jabatan=$jabatan&amp;golongan=$golongan&amp;jns_kursus=$jns_kursus&amp;bulan1=$bulan1&amp;bulan2=$bulan2&amp;tahun1=$tahun1&amp;tahun2=$tahun2&amp;stat_kar=$stat_kar&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?pendidikan=$pendidikan&amp;jabatan=$jabatan&amp;golongan=$golongan&amp;jns_kursus=$jns_kursus&amp;bulan1=$bulan1&amp;bulan2=$bulan2&amp;tahun1=$tahun1&amp;tahun2=$tahun2&amp;stat_kar=$stat_kar&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?pendidikan=$pendidikan&amp;jabatan=$jabatan&amp;golongan=$golongan&amp;jns_kursus=$jns_kursus&amp;bulan1=$bulan1&amp;bulan2=$bulan2&amp;tahun1=$tahun1&amp;tahun2=$tahun2&amp;stat_kar=$stat_kar&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?pendidikan=$pendidikan&amp;jabatan=$jabatan&amp;golongan=$golongan&amp;jns_kursus=$jns_kursus&amp;bulan1=$bulan1&amp;bulan2=$bulan2&amp;tahun1=$tahun1&amp;tahun2=$tahun2&amp;stat_kar=$stat_kar&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?pendidikan=$pendidikan&amp;jabatan=$jabatan&amp;golongan=$golongan&amp;jns_kursus=$jns_kursus&amp;bulan1=$bulan1&amp;bulan2=$bulan2&amp;tahun1=$tahun1&amp;tahun2=$tahun2&amp;stat_kar=$stat_kar&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;st=$st&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	<td align=right valign=middle>";
	echo"</td><td align=right>&nbsp;</td>
	</tr></table><br>";
}

/////////////
// footer navigation (paging) MEDICAL CUTI
function PagingMedCut($pager,$page,$next,$limit,$keyword,$show,$conn,$status,$divisi,$bulan1,$bulan2,$tahun1,$tahun2,$jenis_cuti){
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=100%><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?jenis_cuti=$jenis_cuti&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;status=$status&amp;bulan1=$bulan1&amp;bulan2=$bulan2&amp;tahun1=$tahun1&amp;tahun2=$tahun2&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?jenis_cuti=$jenis_cuti&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;status=$status&amp;bulan1=$bulan1&amp;bulan2=$bulan2&amp;tahun1=$tahun1&amp;tahun2=$tahun2&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?jenis_cuti=$jenis_cuti&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;status=$status&amp;bulan1=$bulan1&amp;bulan2=$bulan2&amp;tahun1=$tahun1&amp;tahun2=$tahun2&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?jenis_cuti=$jenis_cuti&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;status=$status&amp;bulan1=$bulan1&amp;bulan2=$bulan2&amp;tahun1=$tahun1&amp;tahun2=$tahun2&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?jenis_cuti=$jenis_cuti&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;status=$status&amp;bulan1=$bulan1&amp;bulan2=$bulan2&amp;tahun1=$tahun1&amp;tahun2=$tahun2&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	<td align=right valign=middle>";
	echo"</td>
	</tr></table><br>";
}

///////// PAGING MEDICAL SAJA
function PagingMedSaja($pager,$page,$next,$limit,$keyword,$show,$conn,$status,$divisi,$jenis,$awal,$akhir,$jenis_cuti){
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=100%><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?jenis_cuti=$jenis_cuti&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;status=$status&amp;jenis=$jenis&amp;awal=$awal&amp;akhir=$akhir&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?jenis_cuti=$jenis_cuti&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;status=$status&amp;jenis=$jenis&amp;awal=$awal&amp;akhir=$akhir&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?jenis_cuti=$jenis_cuti&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;status=$status&amp;jenis=$jenis&amp;awal=$awal&amp;akhir=$akhir&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?jenis_cuti=$jenis_cuti&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;status=$status&amp;jenis=$jenis&amp;awal=$awal&amp;akhir=$akhir&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?jenis_cuti=$jenis_cuti&amp;show=$show&amp;divisi=$divisi&amp;keyword=$keyword&amp;status=$status&amp;jenis=$jenis&amp;awal=$awal&amp;akhir=$akhir&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	<td align=right valign=middle>";
	echo"</td>
	</tr></table><br>";
}

///////////////////
function PagingPel($pager,$page,$next,$limit,$nama,$alamat,$pengalaman,$dari,$sampai,$pendidikan,$skill)
{
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=100%><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?nama=$nama&amp;alamat=$alamat&amp;pengalaman=$pengalaman&amp;dari=$dari&amp;sampai=$sampai&amp;pendidikan=$pendidikan&amp;skill=$skill&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?nama=$nama&amp;alamat=$alamat&amp;pengalaman=$pengalaman&amp;dari=$dari&amp;sampai=$sampai&amp;pendidikan=$pendidikan&amp;skill=$skill&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?nama=$nama&amp;alamat=$alamat&amp;pengalaman=$pengalaman&amp;dari=$dari&amp;sampai=$sampai&amp;pendidikan=$pendidikan&amp;skill=$skill&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?nama=$nama&amp;alamat=$alamat&amp;pengalaman=$pengalaman&amp;dari=$dari&amp;sampai=$sampai&amp;pendidikan=$pendidikan&amp;skill=$skill&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?nama=$nama&amp;alamat=$alamat&amp;pengalaman=$pengalaman&amp;dari=$dari&amp;sampai=$sampai&amp;pendidikan=$pendidikan&amp;skill=$skill&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	<td align=right valign=middle>";
	echo"</td>
	</tr></table><br>";
}


// footer navigation (paging)
function Paging1($pager,$page,$next,$limit,$keyword,$show){
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	//echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='font-size:9px; border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=100% class=table_indent2><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?show=$show&amp;keyword=$keyword&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?show=$show&amp;keyword=$keyword&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?show=$show&amp;keyword=$keyword&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?show=$show&amp;keyword=$keyword&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?show=$show&amp;keyword=$keyword&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	<td align=right>&nbsp;</td>
	</tr></table><br>";
}

// footer navigation (paging)
function Paging17($pager,$page,$next,$limit,$keyword,$show,$n){
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	//echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='font-size:9px; border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=100% class=table_indent2><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?n=$n&amp;show=$show&amp;keyword=$keyword&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?n=$n&amp;show=$show&amp;keyword=$keyword&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?n=$n&amp;show=$show&amp;keyword=$keyword&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?n=$n&amp;show=$show&amp;keyword=$keyword&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?n=$n&amp;show=$show&amp;keyword=$keyword&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	<td align=right>&nbsp;</td>
	</tr></table><br>";
}

function Paging3($pager,$page,$next,$limit,$keyword,$show,$divisi,$tahun1){
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	//echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='font-size:9px; border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=100% class=table_indent2><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?divisi=$divisi&amp;tahun1=$tahun1&amp;show=$show&amp;keyword=$keyword&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?divisi=$divisi&amp;tahun1=$tahun1&amp;show=$show&amp;keyword=$keyword&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?divisi=$divisi&amp;tahun1=$tahun1&amp;show=$show&amp;keyword=$keyword&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?divisi=$divisi&amp;tahun1=$tahun1&amp;show=$show&amp;keyword=$keyword&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?divisi=$divisi&amp;tahun1=$tahun1&amp;show=$show&amp;keyword=$keyword&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	<td align=right>&nbsp;</td>
	</tr></table><br>";
}

/////////////PAGING 2 DIGUNAKAN PADA PAGING PARAMETER SETUP
// footer navigation (paging)
function Paging2($pager,$page,$next,$limit,$keyword,$show,$group){
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	//echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='font-size:9px; border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=100% class='table_indent2'><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?show=$show&amp;keyword=$keyword&amp;group=$group&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?show=$show&amp;keyword=$keyword&amp;group=$group&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?show=$show&amp;keyword=$keyword&amp;group=$group&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?show=$show&amp;keyword=$keyword&amp;group=$group&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?show=$show&amp;keyword=$keyword&amp;group=$group&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	<td align=right>&nbsp;</td>
	</tr></table><br>";
}

/////////////
// footer navigation (paging) Paging Filter (Search)
//function PagingFilter($pager,$page,$next,$limit,$keyword,$show,$unit_kerja,$status_kerja){
//function PagingFilter($pager,$page,$next,$limit,$keyword,$show,$pendidikan,$fungsional,$skill)
function PagingFilter($pager,$page,$next,$limit,$keyword,$show,$pendidikan,$fungsional,$skill,$log_id,$status,$divisi)
{
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=93% class='table_indent'><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?divisi=$divisi&amp;log_id=$log_id&amp;status=$status&amp;show=$show&amp;pendidikan=$pendidikan&amp;skill=$skill&amp;fungsional=$fungsional&amp;keyword=$keyword&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?divisi=$divisi&amp;log_id=$log_id&amp;status=$status&amp;show=$show&amp;pendidikan=$pendidikan&amp;skill=$skill&amp;fungsional=$fungsional&amp;keyword=$keyword&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?divisi=$divisi&amp;log_id=$log_id&amp;status=$status&amp;show=$show&amp;pendidikan=$pendidikan&amp;skill=$skill&amp;fungsional=$fungsional&amp;keyword=$keyword&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?divisi=$divisi&amp;log_id=$log_id&amp;status=$status&amp;show=$show&amp;pendidikan=$pendidikan&amp;skill=$skill&amp;fungsional=$fungsional&amp;keyword=$keyword&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?divisi=$divisi&amp;log_id=$log_id&amp;status=$status&amp;show=$show&amp;pendidikan=$pendidikan&amp;skill=$skill&amp;fungsional=$fungsional&amp;keyword=$keyword&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	</tr></table><br>";
}

// paging jika pencarian umum

function PagingFilterKey($pager,$page,$next,$limit,$show,$key){
	/*
		NAVIGASI HALAMAN (PAGING)
	*/
	
		// Total halaman
		$total_pages	= $pager->numPages; 
		// Jumlah no halaman/navigasi per segmen halaman
		$limitpage 		= 5; 
		if($total_pages <= $limitpage)
		{
			$limitpage = $total_pages;
		}
		else
		{
			$limitpage 	= 5; 
		}
	
	//$segment		= ceil($total_pages/$limitpage); 

	// Menampilkan keterangan Halaman :
	/*
		Contoh :
		Halaman ke 1 dari 100 halaman yang tersedia.
	*/
	echo"<br>";
	//echo"<br>Halaman ke <b>$page</b> dari $total_pages.";
	
	// validasi range halaman
	if($next == NULL)
	{
		$LP		= $limitpage;
	}
	else{
		if(($total_pages-$next) <= $limitpage){
			$LP	= $total_pages;
		}
		else{
			$LP = ($limitpage+$next);
		}
	}
	
	/* 	
		menampilkan navigasi halaman
		contoh : awal | prev | 1 2 3 4 5 n | next | akhir
	*/
	
	// awal table
	echo"<table border=0 style='border-bottom:solid 1px #dfe7ed; border-top:solid 1px #dfe7ed;' width=93% class='table_indent'><tr><td>";
	if ($page == 1)
	{
		echo "awal &laquo;";
	}
	else
	{
		if($page <= $limitpage)
		{
			echo "awal &laquo;";
		}
		else
		{
			echo"<a href='$PHP_SELF?show=$show&amp;key=$key&amp;keyword=$keyword&amp;next&amp;page=' style='text-decoration:none;'>awal</a> ";
			echo"<a href='$PHP_SELF?show=$show&amp;key=$key&amp;keyword=$keyword&amp;next=".($next-$limitpage)."&amp;page=".(($next-$limitpage)+1)."' style='text-decoration:none;'>&laquo;</a>";
		}
	}
	
	for ($i = (($LP-$limitpage)+1); $i <= $LP; $i++) 
	{
		echo " | ";
		if ($i == $pager->page)
		{
			echo " <b>$i</b>";
		}
		else
		{
			echo "<a href=\"$PHP_SELF?show=$show&amp;key=$key&amp;keyword=$keyword&amp;next=$next&amp;page=$i\" style='text-decoration:none;'>$i</a>";
		}
	}
	
	if ($page == $pager->numPages)
	{
		echo " | &raquo; akhir";
	}
	else
	{
		if(($total_pages-$next) <= $limitpage)
		{
			echo " | &raquo; akhir";
		}
		else
		{
			echo " | <a href='$PHP_SELF?show=$show&amp;key=$key&amp;keyword=$keyword&amp;next=$LP&amp;page=$i' style='text-decoration:none;'>&raquo;</a>";
			echo" <a href='$PHP_SELF?show=$show&amp;key=$key&amp;keyword=$keyword&amp;next=".($total_pages-$limitpage)."&amp;page=".($total_pages-$limitpage+1)."' style='text-decoration:none;'>akhir</a>";
		}
	}
	echo"</td>
	</tr></table><br>";
}


function SearchFilter($cat,$conn,$log_id){
	echo"
	<!--<fieldset width='80%'><legend>Pencarian</legend>-->
	<form name='cvsearch' action=search.php method='get'>
	<table width=93% class='table_indent' border=0>
	 <tr>
	  <td style='width: 75px;'>Nama/NIK:</td>
	  <td style='width: 250px;'>
	  <input type=hidden name=log_id value='$log_id'>
	  <input type=text size=40 name='keyword'></td>
	  <td align=left'><div align=right>Pendidikan:</div></td>
	  <td>
	  <!--<label><input type='checkbox' value='ok' onclick='javascript:enableField();' onclick='javascript:enableField();'>Advance Search</label><br><br>-->
	   <select style='width: 350px;' name='pendidikan' id='pendidikan'>
    	<option value=''>--- Silahkan Pilih ---</option>
	   ";
		$sqlP = mssql_query("SELECT * FROM MstPendidikan ORDER BY keterangan,jurusan ASC",$conn);
		while($rowP = mssql_fetch_array($sqlP)){
			echo"<option value='$rowP[Pend_ID]'>$rowP[keterangan] - $rowP[jurusan]</option>";
		}
	echo"
	   </select>
	  </td>
	 </tr>
	 <tr>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td align=right>Keahlian/Spesialisasi:</td>
	  <td><input type='text' name='skill' style='width: 344px;'></td>
	 </tr>
	 <tr>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td align=right>Fungsional:</td>
	  <td>
	   <select style='width: 350px;' name='fungsional' id='fungsional'>
    	<option value=''>--- Silahkan Pilih ---</option>
	   ";
		$sqlF = mssql_query("SELECT * FROM MstFungsional ORDER BY nama",$conn);
		while($rowF = mssql_fetch_array($sqlF)){
			echo"<option value='$rowF[kode]'>$rowF[nama]</option>";
		}
	echo"
	   </select>
	  </td>
	 </tr>
	 <tr>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td align=right>Status Kerja:</td>
	  <td>
	   <select style='width: 350px;' name='status' id='status'>
    	<option value=''>--- Silahkan Pilih ---</option>
    	<option value='bekerja'>Bekerja</option>
    	<option value='berhenti'>Berhenti</option>
	   ";
	echo"
	   </select>
	  </td>
	 </tr>";
	echo"
	 <tr>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td align=right>Divisi/SBU/Unit Kerja:</td>
	  <td>
	   <select name='divisi' style='width: 350px;'>
    	<option value=''>--- Silahkan Pilih ---</option>";
		// get divisi
		$sdiv = mssql_query("SELECT * FROM VLevelCabang WHERE status='1' ORDER BY uraian ASC",$conn);
		while($rdiv = mssql_fetch_array($sdiv)){
			echo"<option value='$rdiv[kode_so]'>$rdiv[uraian]</option>";
		}
	   echo"</select>
	  </td>
	 </tr>
	";
	echo"
	 <tr>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td align=right>Pengalaman:</td>
	  <td><input type='text' name='pengalaman' style='width: 344px;'></td>
	 </tr>
	 <tr>
	  <td colspan=4 align=left>
  	  <input type='hidden' name='show' value='$cat'><input type=submit value=Cari class=button>
	  <!--<label><input type='checkbox' onclick='DisableField();' id='cek' name='cek'> Aktifkan Advance Search</label>-->
	  <!--
	  <input type='button' value='Pencarian Umum' style='width=150px;' onclick=\"PromptSearch();\" class='button'>
	  -->
	  </td>
	 </tr>
	</table>
	</form>
	";//*/
}

// head untuk sanksi
function SearchSanksi($conn,$st,$filter,$show,$keyword,$b1,$b2,$t1,$t2)
{
echo"
<form method='get' action=search.php>
<fieldset><legend>Pencarian Sanksi Pegawai:</legend>
		   <table border=0>
		    <tr>
			 <td align=left>&nbsp;&nbsp;&nbsp;Masukkan NIK/Nama:
			 <input type='text' name='keyword'>
			 <input type='hidden' name='show' value='sanksi'>&nbsp;&nbsp;&nbsp;Status Kerja:&nbsp;&nbsp;&nbsp;<select name='st'>
			 <option value=''>--semua--</option>
			 <option value='bekerja'>Bekerja</option>
			 <option value='berhenti'>Berhenti</option>
			 </select><br>&nbsp;&nbsp;
			 Filter Kategori: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select name=filter>
			 <!--onclick='Javascript:location.href=\"search.php?show=sanksi&amp;filter=\"'> -->
			 <!--onclick='Javascript:location.href=\"search.php?show=sanksi&amp;filter=$rq[kode]\"' -->
			 <option value=''> --semua--</option>";
			 $sq = mssql_query("SELECT kode,nama FROM VKatSanksi ORDER BY nama ASC",$conn);
			 while($rq = mssql_fetch_array($sq)){
			 	echo"<option value='$rq[kode]'>$rq[nama]</option>";
			 }
			 echo"</select>";
echo"&nbsp;&nbsp;Range: 
<select name='b1'>
		   <option value=''></option>
		   <option value='1'>Januari</option>
		   <option value='2'>Februari</option>
		   <option value='3'>Maret</option>
		   <option value='4'>April</option>
		   <option value='5'>Mei</option>
		   <option value='6'>Juni</option>
		   <option value='7'>Juli</option>
		   <option value='8'>Agustus</option>
		   <option value='9'>September</option>
		   <option value='10'>Oktober</option>
		   <option value='11'>November</option>
		   <option value='12'>Desember</option>
		  </select>
		  <select name='t1'>";
		 $qt1 = mssql_query("SELECT year(tgl_laku) tahun FROM VSanksi GROUP BY year(tgl_laku)",$conn);
		 while($rt1 = mssql_fetch_array($qt1)){
			echo"<option value='$rt1[tahun]'>$rt1[tahun]</option>";
		 }
		 echo" </select>
		  &nbsp;-&nbsp;
		  <select name='b2'>
		   <option value=''></option>
		   <option value='1'>Januari</option>
		   <option value='2'>Februari</option>
		   <option value='3'>Maret</option>
		   <option value='4'>April</option>
		   <option value='5'>Mei</option>
		   <option value='6'>Juni</option>
		   <option value='7'>Juli</option>
		   <option value='8'>Agustus</option>
		   <option value='9'>September</option>
		   <option value='10'>Oktober</option>
		   <option value='11'>November</option>
		   <option value='12'>Desember</option>
		  </select>
		  <select name='t2'>";
		 $qt2 = mssql_query("SELECT year(tgl_laku) tahun FROM VSanksi GROUP BY year(tgl_laku)",$conn);
		 while($rt = mssql_fetch_array($qt2)){
			echo"<option value='$rt[tahun]'>$rt[tahun]</option>";
		 }
		  echo"</select> </td>
			</tr>
			<tr>
			 <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=button value='Export Excel' class=button Onclick='Javascript:window.open(\"exp_excel_sanksi.php?st=$st&amp;keyword=$keyword&amp;filter=$filter&amp;b1=$b1&amp;t1=&amp;b2=&amp;t2=\");'><input type=submit value='Cari' class=button></td>
			</tr>
		   </table>
		   </form>";
}
?>